1. Field of the Invention
The present invention relates to digital imaging apparatuses, such as digital still cameras and digital video cameras, and image processing using image processing software. More particularly, the present invention relates to an apparatus and a method for detecting a specific subject, such as a person, an animal, or an object, or a portion of the subject included in a still image or a moving image.
2. Related Background Art
An image processing method for automatically detecting a pattern of a specific subject in an image is very useful for determining a human face, for example. Such a method is applied in various fields, such as a communications conference, a man-machine interface, security, a monitoring system for tracing a human face, and image compression.
Various techniques for detecting a face in an image are disclosed in, for example, “Detecting Faces in Images: A Survey” IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 24, NO. 1, JANUARY 2002.
In the disclosed techniques, some specific features (e.g., eyes, mouth, and nose) and geometric positional relationship among the features are utilized for detecting a human face. Alternatively, a symmetrical feature of a human face, a feature of a human face color, template matching, and a neural network, for example, can be utilized for detecting a human face.
“Neural network-based face detection” IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 20, NO. 1, JANUARY 1998 discloses a method for detecting a face pattern in an image utilizing a neural network. The method for detecting the face pattern will be briefly described hereinafter.
Image data including an image of a human face to be detected is stored in a memory. Regions, each of which is to be checked whether a face image is included, are successively cut out from the stored image. The distribution of pixel values in the cutout region is used as an input for calculation using a neural network to obtain an output as a result of the calculation. Here, a weight and a threshold value of the neural network are obtained in advance with reference to a large number of face-image patterns and non-face-image patterns. For example, if the output of the neural network is greater than 0, it is determined that the region includes a face image, otherwise, it is determined that the region includes a non-face image.
Then, the cutout regions including image patterns, each of which is to be checked for whether a face image is included and each of which is an input of the neural network, are scanned in the horizontal direction for successive rows in the entire image, for example, as described in FIG. 6, whereby a face image is detected in the image. Furthermore, since it is preferable that any face images of various sizes are detected, the stored image is successively made smaller by a predetermined amount as shown in FIG. 6, and the scanning as described above is performed for detecting a face image.
“Rapid Object Detection using Boosted Cascade of Simple Features” Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR'01) also discloses object detection processing paying attention to rapid processing. In this document, AdaBoost algorithm is used and weak discriminators are effectively used in combination, whereby the accuracy of face detection is improved. In addition, each of the weak discriminators is configured by Haar-like rectangle features, and moreover, the rectangle features are calculated at high speed using an integral image. Furthermore, discriminators using features obtained by AdaBoost learning are connected with one another in series to configure a cascade face detector.
The cascade face detector immediately eliminates candidates of patterns which are apparently not determined as face images using a simple detector (that is, a detector which needs a small number of calculations) in a first stage. Thereafter, only for candidates other than the candidates which are apparently not determined as face images, the cascade face detector performs the determination as to whether the face image is included using a complicated detector (that is, a detector which needs a large number of calculations) having a higher discrimination capability in a second stage. Accordingly, it is not necessary to perform complicated determination for all candidates, and therefore, processing is performed rapidly.
In addition, since rectangle features obtained using a Haar-like filter are calculated using an integral image in a fixed calculation cost irrespective of an area of the image, it is not necessary to consider processing cost for selecting weak discriminators.
However, according to the method disclosed in the “Neural network-based face detection” document, face discrimination processing should be performed a large number of times on one image, and this leads to a problem of processing speed.
Furthermore, according to the method disclosed in the “Rapid Object Detection using Boosted Cascade of Simple Features” document, to configure a face detector having high accuracy, it is necessary to calculate more than 6000 rectangle features. Moreover, since rectangle features are obtained by detecting luminance contrasts in the vertical direction and the horizontal direction, if a subject to be discriminated has many features in the diagonal direction, the rectangle features are not calculated by the same method. Therefore, for example, a weak discriminator using features capable of detecting a luminance contrast in the diagonal direction should be provided.
In addition, when the weak discriminator is configured using a filter feature other than a Haar-like feature or other than a rectangle feature, the weak discriminator obtains a high degree of freedom, and therefore, accuracy as a single weak discriminator may be improved as needed. However, the integral image described above cannot be used and calculation cost is increased due to an area of a filter. Accordingly, an improvement in accuracy which is worthy of the increased calculation cost is not attained.